﻿using System;
using System.Collections.Generic;

using System.Text;

namespace A2Z.BusinessObjects
{
    public class ProjectImage
    {
        public ProjectImage(int id,string title, string linkUrl, string type, string imageUrl )
        {
            this.id = id;
            this.title = title;
            this.linkUrl = linkUrl;
            this.imageUrl = imageUrl;
            this.type = type;
        }
         public ProjectImage( )
        { 
        }
         private int id;

         public int Id
         {
             get { return id; }
             set { id = value; }
         }
        private string imageUrl;

        public string ImageUrl
        {
            get { return imageUrl; }
            set { imageUrl = value; }
        }
        private string title;

        public string Title
        {
            get { return title; }
            set { title = value; }
        }
        private string linkUrl;

        public string LinkUrl
        {
            get { return linkUrl; }
            set { linkUrl = value; }
        }
        private string type;

        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public ProjectImage praseProjectsImage(string json) {
            ProjectImage projectImage = new ProjectImage();
            return projectImage;
        }
        public string GetJSON()
        {
            string json = string.Empty;
            json += "{";
            json += "'title':'"+this.title+"',";
            json += "'imageUrl':'" + this.imageUrl + "',";
            json += "'linkUrl':'" + this.linkUrl + "',";
            json += "'type':'" + this.type + "'";
          

            

            json +="}";


            return json;
        }
        static string GetListJSON(List<ProjectImage> listProjectImage)
        { 
            string listJSON = string.Empty;
            listJSON += "[";
            foreach (ProjectImage projectImage in listProjectImage)
            {
                listJSON += projectImage.GetJSON() + ",";
            }
            listJSON.Remove(listJSON.Length - 1, 1);
          
            listJSON+="]";
            return listJSON;
        }

    }
}
